#!/usr/bin/env bash

rm -rf \
${PATH_NAME_01_ORIGIN} \
${PATH_NAME_02_ORIGIN} \
${PATH_NAME_01} \
${PATH_NAME_02} \
${PATH_NAME_01_NEW_GIT_CLONE}

mkdir ${PATH_NAME_01_ORIGIN}
cd ${PATH_NAME_01_ORIGIN}
git init --bare

mkdir ${PATH_NAME_02_ORIGIN}
cd ${PATH_NAME_02_ORIGIN}
git init --bare

git clone ${PATH_NAME_01_ORIGIN} ${PATH_NAME_01}
git clone ${PATH_NAME_02_ORIGIN} ${PATH_NAME_02}

cd ${PATH_NAME_01}
git init
cp -f ${PATH_GIT_TEST}/111.txt 111.txt
git add 111.txt
git commit -m "add 111.txt"
git push

cd ${PATH_NAME_02}
git init
cp -f ${PATH_GIT_TEST}/222.txt 222.txt
git add 222.txt
git commit -m "add 222.txt"
git push

cd ${PATH_NAME_01}
git subtree add --prefix=${DIR_NAME_02} --squash ${PATH_NAME_02_ORIGIN} master
git push

